<?php
/* Class VerificationObject
 * Documentation can be found at:
* https://github.com/mozilla/openbadges/wiki/Assertions#verificationobject */

class VerificationObject {
	
	/* Mandatory fields */
	private $type;
	private $url;
	
	/* Getters & Setters */
	public function getType() {
		return $this->type;
	}

	public function setType($type) {
		$this->type = $type;
	}
	
	public function getURL() {
		return $this->url;
	}

	public function setURL($url) {
		$this->url = $url;
	}
	
	public function checkValidity() {
		return isset($this->type) && isset($this->url);
	}
	
	public function getArray() {
	
		if (!$this->checkValidity())
			return null;
	
		$array["type"] = $this->type;
		$array["url"] = $this->url;
		
		return $array;
	}
}
?>